﻿@{
    Layout = null;
}
@model System.Collections.IEnumerable
<!DOCTYPE html>
<html>
@Html.Partial("LoadPanelPartial")
<head>
    @if (false)
    {
        <script src="../../../../Scripts/jquery-vsdoc.js" type="text/javascript"></script>
        <script src="../../../../Scripts/ASPxScriptIntelliSense.js" type="text/javascript"></script>
    }
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>
     <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>
    @Html.DevExpress().GetStyleSheets(
                new StyleSheet { ExtensionType = ExtensionType.GridView, Theme = DevExpressHelper.Theme }

)
    <script type="text/javascript">

        function OnBeginCallback(s, e) {
            e.customArgs["command"] = e.command;
        }


        function codeAdd() {
            $("#popContent").attr("src", rootPath + "/EnterpriseFinanceProp/EnterpriseFinancePropEdit");
            codeModalMode.Show();
        }

        function codeEdit(codeNo) {
            $("#popContent").attr("src", rootPath + "/EnterpriseFinanceProp/EnterpriseFinancePropEdit?fEnterprisePropNo=" + codeNo);
            codeModalMode.Show();
        }

        //编码保存确定
        function codeOK() {
            alert("保存成功");
            codeModalMode.Hide();
            gvEditing.Refresh();
        }

        //编码保存取消
        function codeCancel() {
            codeModalMode.Hide();
        }

        function MenuTop_emClick(source, e) {
            switch (e.item.name) {
                case "btnAdd":
                    {
                        //增加
                        codeAdd();
                        break;
                    }


            }
        }
        
    </script>
</head>
<body>
    @using (Html.BeginForm("", "", FormMethod.Post, new { id = "form1", @class = "edit_form" }))
    {
        @Html.DevExpress().Menu(settings =>
   {
       settings.Name = "toolBarMenu";
       settings.ItemAutoWidth = false;
       settings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
       settings.Styles.Style.Border.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(0);
       settings.Styles.Style.BorderTop.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(1);
       settings.Items.Add(item =>
       {
           item.Name = "btnAdd";
           item.Text = "增加";
           item.Image.Url = Url.Content("~/Content/ControlImages/edit_add.png");
       });

       settings.ClientSideEvents.ItemClick = "function(source,e){MenuTop_emClick(source,e)}";
       settings.ItemLinkMode = ItemLinkMode.ContentBounds;
   }).GetHtml()
       
        @Html.Partial("EnterpriseFinancePropListPartial", Model)
        @Html.DevExpress().PopupControl(
    settings =>
    {
        settings.Name = "codeModalMode";
        settings.Width = 600;
        settings.Height = 250;
        settings.AllowDragging = true;
        settings.CloseAction = CloseAction.CloseButton;
        settings.EnableAnimation = false;
        settings.HeaderText = "企业性质定义";
        settings.Modal = true;
        settings.PopupHorizontalAlign = PopupHorizontalAlign.WindowCenter;
        settings.PopupVerticalAlign = PopupVerticalAlign.WindowCenter;
        settings.ShowFooter = true;
        settings.SetFooterTemplateContent(s =>
        {
            ViewContext.Writer.Write("<table align='center'><tr><td>");
            @Html.DevExpress().Button(footBtnSettings =>
            {
                footBtnSettings.Name = "btnOK";
                footBtnSettings.Text = "确定";
                footBtnSettings.ClientSideEvents.Click = "function(s,e){popContent.OK()}";
                footBtnSettings.Images.Image.Url = Url.Content("~/Content/ControlImages/ok.png");
                footBtnSettings.CausesValidation = false;
            }).GetHtml();
            ViewContext.Writer.Write("</td><td>");
            @Html.DevExpress().Button(footBtnSettings =>
            {
                footBtnSettings.Name = "btnCancel";
                footBtnSettings.Text = "取消";
                footBtnSettings.ClientSideEvents.Click = "codeCancel";
                footBtnSettings.Images.Image.Url = Url.Content("~/Content/ControlImages/no.png");
                footBtnSettings.CausesValidation = false;
            }).GetHtml();
            ViewContext.Writer.Write("</td></tr></table>");

        });
        settings.SetContent(() =>
       {
           ViewContext.Writer.Write("<iframe  id='popContent' name='popContent' style='width:100%;height:200px' frameborder='0' ></iframe>");
       });
    }).GetHtml()

    }
    <script>
        lp.Hide();
    </script>
</body>
</html>
